using System;
using System.Data.Linq.Mapping;
using CoreLibrary.Date;
using Entities.Enumeration;

namespace Entities.DataBase.Persistent {

    [Table(Name="D_ORDER")]
    public class Order {

        public Order() {
            CourierId       = Courier.Other.Code;
            Status          = OrderStatus.Pending;
            DateCreated     = DateTime.UtcNow;
            DateUpdated     = DateUtil.Epoch;
            CustomerId      = string.Empty;
            Description     = string.Empty;
            TrackingId      = string.Empty;
        }

        [Column(Name = "ID", IsPrimaryKey = true, IsDbGenerated = true)]
        public int OrderId { get; set; }

        [Column(Name = "GUID")]
        public string Guid { get; set; }

        [Column(Name = "OPERATOR_ID")]
        public string OperatorId   { get; set; }

        [Column(Name = "CUSTOMER_ID")]
        public string CustomerId { get; set; }

        [Column(Name = "STATUS")]
        public int Status { get; set; }

        [Column(Name = "TOTAL_COST")]
        public decimal Cost { get; set; }

        [Column(Name = "TOTAL_PRICE")]
        public decimal Price { get; set; }

        [Column(Name = "TOTAL_PROFIT")]
        public decimal Profit { get; set; }

        [Column(Name = "DESCRIPTION")]
        public string  Description { get; set; }

        [Column(Name = "ORDER_POSTAGE")]
        public decimal OrderPostage { get; set; }

        [Column(Name = "TOTAL_POSTAGE")]
        public decimal TotalPostage { get; set; }
        
        [Column(Name = "COURIER_ID")]
        public int CourierId { get; set; }

        [Column(Name = "TRACKING_ID")]
        public string TrackingId { get; set; }

        [Column(Name = "CURRENCY_RATE")]
        public decimal Rate { get; set; }

        [Column(Name = "DATE_CREATED")]
        public DateTime DateCreated { get; set; }
        
        [Column(Name = "DATE_UPDATED")]
        public DateTime DateUpdated { get; set; }

    }
}